package com.applet.mallappletbackstage.controller;


import com.applet.mallappletbackstage.entity.UserReleaseWork;
import com.applet.mallappletbackstage.service.UserReleaseWorkService;
import com.applet.mallappletbackstage.utils.R;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author ${author}
 * @since 2020-07-31
 */
@RestController
@RequestMapping("/user-release-work")
public class UserReleaseWorkController {

    @Autowired
    UserReleaseWorkService userReleaseWorkService;

    @GetMapping("one/{id}")
    public R getOne(@PathVariable String id) {
        QueryWrapper<UserReleaseWork> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("release_work_id", id);
        UserReleaseWork releaseWork = userReleaseWorkService.getOne(queryWrapper);
        return R.success(releaseWork);
    }
}

